package com.party.core.model.collect;

import com.party.core.model.BaseModel;

import java.util.Date;

/**
 * @Description: 系统模块访问收集
 * @Author: yangshoukun
 * @Date: 2018/6/20 16:32
 */
public class SystemModuleCollect extends BaseModel {
    private static final long serialVersionUID = -1561806826388996465L;

    // 模块code
    private String module;
    // pv量
    private Long pvNum;
    // uv量
    private Long uvNum;

    public String getModule() {
        return module;
    }

    public void setModule(String module) {
        this.module = module;
    }

    public Long getPvNum() {
        return pvNum;
    }

    public void setPvNum(Long pvNum) {
        this.pvNum = pvNum;
    }

    public Long getUvNum() {
        return uvNum;
    }

    public void setUvNum(Long uvNum) {
        this.uvNum = uvNum;
    }

    public SystemModuleCollect() {}

    public SystemModuleCollect(String module, Date createDate, Long pvNum, Long uvNum) {
        this.module = module;
        this.pvNum = pvNum;
        this.uvNum = uvNum;
        super.setCreateDate(createDate);
    }

    @Override
    public String toString() {
        return "SystemModuleCollect{" +
                "module='" + module + '\'' +
                ", pvNum=" + pvNum +
                ", uvNum=" + uvNum +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof SystemModuleCollect)) return false;
        if (!super.equals(o)) return false;

        SystemModuleCollect that = (SystemModuleCollect) o;

        if (module != null ? !module.equals(that.module) : that.module != null) return false;
        if (pvNum != null ? !pvNum.equals(that.pvNum) : that.pvNum != null) return false;
        return uvNum != null ? uvNum.equals(that.uvNum) : that.uvNum == null;
    }

    @Override
    public int hashCode() {
        int result = super.hashCode();
        result = 31 * result + (module != null ? module.hashCode() : 0);
        result = 31 * result + (pvNum != null ? pvNum.hashCode() : 0);
        result = 31 * result + (uvNum != null ? uvNum.hashCode() : 0);
        return result;
    }
}
